home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / python2.6 / curses / __init__.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  1.6 KB  |  52 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. '''curses
  5.  
  6. The main package for curses support for Python.  Normally used by importing
  7. the package, and perhaps a particular module inside it.
  8.  
  9.    import curses
  10.    from curses import textpad
  11.    curses.initwin()
  12.    ...
  13.  
  14. '''
  15. __revision__ = '$Id: __init__.py 61064 2008-02-25 16:29:58Z andrew.kuchling $'
  16. from _curses import *
  17. from curses.wrapper import wrapper
  18. import os as _os
  19. import sys as _sys
  20.  
  21. def initscr():
  22.     import _curses
  23.     import curses
  24.     setupterm(term = _os.environ.get('TERM', 'unknown'), fd = _sys.__stdout__.fileno())
  25.     stdscr = _curses.initscr()
  26.     for key, value in _curses.__dict__.items():
  27.         if key[0:4] == 'ACS_' or key in ('LINES', 'COLS'):
  28.             setattr(curses, key, value)
  29.             continue
  30.     
  31.     return stdscr
  32.  
  33.  
  34. def start_color():
  35.     import _curses
  36.     import curses
  37.     retval = _curses.start_color()
  38.     if hasattr(_curses, 'COLORS'):
  39.         curses.COLORS = _curses.COLORS
  40.     
  41.     if hasattr(_curses, 'COLOR_PAIRS'):
  42.         curses.COLOR_PAIRS = _curses.COLOR_PAIRS
  43.     
  44.     return retval
  45.  
  46.  
  47. try:
  48.     has_key
  49. except NameError:
  50.     from has_key import has_key
  51.  
  52.